package com.chasekernan.hxnova.serverui;

//importing used component classes
import org.aswing.JPanel;
import org.aswing.JTabbedPane;
import org.aswing.ext.Form;
import org.aswing.ext.FormRow;
import org.aswing.JLabel;
import org.aswing.JTextField;
import org.aswing.JTextArea;
import org.aswing.JSpacer;
import org.aswing.JButton;
import org.aswing.JComboBox;
import org.aswing.JAdjuster;
import org.aswing.JList;
import org.aswing.JTable;
import org.aswing.JSeparator;
//importing aswing geom classes
import org.aswing.geom.IntDimension;
import org.aswing.geom.IntPoint;
import org.aswing.geom.IntRectangle;
//importing aswing layout classes
import org.aswing.EmptyLayout;
import org.aswing.CenterLayout;
import org.aswing.FlowLayout;
import org.aswing.FlowWrapLayout;
import org.aswing.BorderLayout;
import org.aswing.SoftBoxLayout;
import org.aswing.BoxLayout;
import org.aswing.GridLayout;
//importing aswing border classes
import org.aswing.border.EmptyBorder;
import org.aswing.border.LineBorder;
import org.aswing.border.BevelBorder;
import org.aswing.border.SideLineBorder;
import org.aswing.border.TitledBorder;
import org.aswing.border.SimpleTitledBorder;
import org.aswing.border.CaveBorder;
//importing some additional classes
import org.aswing.ASColor;
import org.aswing.ASWingConstants;

/**
 * NewGameUI
 */
class NewGameUI extends JPanel{
	
	//members define
	private var tabbedPane:JTabbedPane;
	private var basicInfo:Form;
	private var formrow18:FormRow;
	private var label19:JLabel;
	private var gameName:JTextField;
	private var formrow21:FormRow;
	private var label22:JLabel;
	private var descriptionBox:JTextArea;
	private var formrow24:FormRow;
	private var label25:JLabel;
	private var hostPassword:JTextArea;
	private var formrow66:FormRow;
	private var spacer67:JSpacer;
	private var loadComponentsButton:JButton;
	private var mapSettings:Form;
	private var formrow28:FormRow;
	private var label29:JLabel;
	private var mapTypeBox:JComboBox;
	private var formrow31:FormRow;
	private var label32:JLabel;
	private var numStars:JAdjuster;
	private var formrow36:FormRow;
	private var label37:JLabel;
	private var innerRadius:JAdjuster;
	private var formrow39:FormRow;
	private var label40:JLabel;
	private var outerRadius:JAdjuster;
	private var formrow42:FormRow;
	private var spacer44:JSpacer;
	private var previewMapButton:JButton;
	private var playerSettings:JPanel;
	private var raceList:JList;
	private var findRaceButton:JButton;
	private var playersInvolved:JTable;
	private var removePlayerButton:JButton;
	private var label50:JLabel;
	private var raceName:JTextField;
	private var label52:JLabel;
	private var playerName:JTextField;
	private var addPlayerButton:JButton;
	private var victoryConditions:Form;
	private var formrow57:FormRow;
	private var formrow58:FormRow;
	private var formrow59:FormRow;
	private var formrow60:FormRow;
	private var formrow61:FormRow;
	private var separator62:JSeparator;
	private var formrow63:FormRow;
	private var spacer64:JSpacer;
	private var doneButton:JButton;
	
	/**
	 * NewGameUI Constructor
	 */
	public function new(){
		super();
		//component creation
		setLocation(new IntPoint(5, 25));
		setSize(new IntDimension(590, 370));
		var layout6:EmptyLayout = new EmptyLayout();
		setLayout(layout6);
		
		tabbedPane = new JTabbedPane();
		tabbedPane.setLocation(new IntPoint(0, 0));
		tabbedPane.setSize(new IntDimension(590, 370));
		tabbedPane.setTabPlacement(AsWingConstants.TOP);
		
		basicInfo = new Form();
		basicInfo.setName("Basic Info");
		basicInfo.setLocation(new IntPoint(3, 26));
		basicInfo.setSize(new IntDimension(584, 341));
		var border7:EmptyBorder = new EmptyBorder();
		border7.setTop(5);
		border7.setLeft(5);
		border7.setBottom(5);
		border7.setRight(5);
		basicInfo.setBorder(border7);
		basicInfo.setHGap(5);
		basicInfo.setVGap(5);
		
		formrow18 = new FormRow();
		formrow18.setSize(new IntDimension(584, 0));
		formrow18.setColumnChildrenIndecis("-1,0,1,2");
		
		label19 = new JLabel();
		label19.setLocation(new IntPoint(2, 0));
		label19.setSize(new IntDimension(35, 17));
		label19.setText("Name");
		label19.setHorizontalAlignment(AsWingConstants.LEFT);
		
		gameName = new JTextField();
		gameName.setLocation(new IntPoint(85, 0));
		gameName.setSize(new IntDimension(200, 21));
		gameName.setPreferredSize(new IntDimension(200, 21));
		gameName.setHtmlText("Default Name ");
		gameName.setEditable(true);
		gameName.setMaxChars(30);
		
		formrow21 = new FormRow();
		formrow21.setLocation(new IntPoint(5, 31));
		formrow21.setSize(new IntDimension(574, 0));
		formrow21.setColumnChildrenIndecis("-1,0,1,2");
		
		label22 = new JLabel();
		label22.setLocation(new IntPoint(5, 0));
		label22.setSize(new IntDimension(57, 17));
		label22.setText("Description");
		label22.setHorizontalAlignment(AsWingConstants.LEFT);
		
		descriptionBox = new JTextArea();
		descriptionBox.setLocation(new IntPoint(85, 0));
		descriptionBox.setSize(new IntDimension(200, 73));
		descriptionBox.setPreferredSize(new IntDimension(200, 73));
		descriptionBox.setRows(5);
		descriptionBox.setHtmlText("Insert game description here.");
		descriptionBox.setMaxChars(1000);
		
		formrow24 = new FormRow();
		formrow24.setLocation(new IntPoint(5, 109));
		formrow24.setSize(new IntDimension(574, 0));
		formrow24.setColumnChildrenIndecis("-1,0,1,2");
		
		label25 = new JLabel();
		label25.setLocation(new IntPoint(5, 0));
		label25.setSize(new IntDimension(75, 17));
		label25.setText("Host Password");
		label25.setHorizontalAlignment(AsWingConstants.LEFT);
		
		hostPassword = new JTextArea();
		hostPassword.setLocation(new IntPoint(85, 0));
		hostPassword.setSize(new IntDimension(200, 21));
		hostPassword.setDisplayAsPassword(true);
		hostPassword.setMaxChars(20);
		
		formrow66 = new FormRow();
		formrow66.setLocation(new IntPoint(5, 135));
		formrow66.setSize(new IntDimension(574, 0));
		formrow66.setColumnChildrenIndecis("-1,0,1,2");
		
		spacer67 = new JSpacer();
		spacer67.setLocation(new IntPoint(5, 0));
		spacer67.setSize(new IntDimension(75, 0));
		
		loadComponentsButton = new JButton();
		loadComponentsButton.setLocation(new IntPoint(85, 0));
		loadComponentsButton.setSize(new IntDimension(200, 23));
		loadComponentsButton.setText("Load Components");
		
		mapSettings = new Form();
		mapSettings.setName("Map Settings");
		mapSettings.setLocation(new IntPoint(3, 26));
		mapSettings.setSize(new IntDimension(584, 341));
		var border8:EmptyBorder = new EmptyBorder();
		border8.setTop(5);
		border8.setLeft(5);
		border8.setBottom(5);
		border8.setRight(5);
		mapSettings.setBorder(border8);
		mapSettings.setHGap(5);
		mapSettings.setVGap(5);
		
		formrow28 = new FormRow();
		formrow28.setLocation(new IntPoint(5, 5));
		formrow28.setSize(new IntDimension(574, 0));
		formrow28.setColumnChildrenIndecis("-1,0,1,2");
		
		label29 = new JLabel();
		label29.setLocation(new IntPoint(5, 0));
		label29.setSize(new IntDimension(51, 17));
		label29.setText("Map Type");
		label29.setHorizontalAlignment(AsWingConstants.LEFT);
		
		mapTypeBox = new JComboBox();
		mapTypeBox.setLocation(new IntPoint(92, 0));
		mapTypeBox.setSize(new IntDimension(100, 21));
		mapTypeBox.setPreferredSize(new IntDimension(100, 21));
		mapTypeBox.setMaximumRowCount(2);
		
		formrow31 = new FormRow();
		formrow31.setLocation(new IntPoint(5, 31));
		formrow31.setSize(new IntDimension(574, 0));
		formrow31.setColumnChildrenIndecis("-1,0,1,2");
		
		label32 = new JLabel();
		label32.setLocation(new IntPoint(5, 0));
		label32.setSize(new IntDimension(82, 17));
		label32.setText("Number of Stars");
		label32.setHorizontalAlignment(AsWingConstants.LEFT);
		
		numStars = new JAdjuster();
		numStars.setLocation(new IntPoint(92, 0));
		numStars.setSize(new IntDimension(100, 21));
		numStars.setOrientation(AsWingConstants.VERTICAL);
		numStars.setColumns(4);
		
		formrow36 = new FormRow();
		formrow36.setLocation(new IntPoint(5, 57));
		formrow36.setSize(new IntDimension(574, 0));
		formrow36.setColumnChildrenIndecis("-1,0,1,2");
		
		label37 = new JLabel();
		label37.setLocation(new IntPoint(5, 0));
		label37.setSize(new IntDimension(82, 17));
		label37.setText("Inner Radius");
		label37.setHorizontalAlignment(AsWingConstants.LEFT);
		
		innerRadius = new JAdjuster();
		innerRadius.setLocation(new IntPoint(92, 0));
		innerRadius.setSize(new IntDimension(100, 21));
		innerRadius.setColumns(4);
		
		formrow39 = new FormRow();
		formrow39.setLocation(new IntPoint(5, 83));
		formrow39.setSize(new IntDimension(574, 0));
		formrow39.setColumnChildrenIndecis("-1,0,1,2");
		
		label40 = new JLabel();
		label40.setLocation(new IntPoint(5, 0));
		label40.setSize(new IntDimension(82, 17));
		label40.setText("Outer Radius");
		label40.setHorizontalAlignment(AsWingConstants.LEFT);
		
		outerRadius = new JAdjuster();
		outerRadius.setLocation(new IntPoint(92, 0));
		outerRadius.setSize(new IntDimension(100, 21));
		outerRadius.setColumns(4);
		
		formrow42 = new FormRow();
		formrow42.setLocation(new IntPoint(5, 109));
		formrow42.setSize(new IntDimension(574, 0));
		formrow42.setColumnChildrenIndecis("-1,0,1,2");
		
		spacer44 = new JSpacer();
		spacer44.setLocation(new IntPoint(5, 0));
		spacer44.setSize(new IntDimension(82, 0));
		
		previewMapButton = new JButton();
		previewMapButton.setLocation(new IntPoint(92, 0));
		previewMapButton.setSize(new IntDimension(100, 23));
		previewMapButton.setText("Preview");
		
		playerSettings = new JPanel();
		playerSettings.setName("Player Settings");
		playerSettings.setLocation(new IntPoint(3, 26));
		playerSettings.setSize(new IntDimension(584, 341));
		var border9:EmptyBorder = new EmptyBorder();
		border9.setTop(5);
		border9.setLeft(5);
		border9.setBottom(5);
		border9.setRight(5);
		playerSettings.setBorder(border9);
		var layout10:EmptyLayout = new EmptyLayout();
		playerSettings.setLayout(layout10);
		
		raceList = new JList();
		raceList.setLocation(new IntPoint(5, 5));
		raceList.setSize(new IntDimension(135, 300));
		raceList.setListData(['Race #1','Race#2']);
		raceList.setSelectionMode(0);
		
		findRaceButton = new JButton();
		findRaceButton.setLocation(new IntPoint(34, 313));
		findRaceButton.setSize(new IntDimension(72, 23));
		findRaceButton.setText("Find Race");
		
		playersInvolved = new JTable();
		playersInvolved.setLocation(new IntPoint(317, 5));
		playersInvolved.setSize(new IntDimension(261, 300));
		playersInvolved.setSelectionMode(0);
		playersInvolved.setRowHeight(0);
		playersInvolved.setRowMargin(-3);
		playersInvolved.setVerticalUnitIncrement(3);
		playersInvolved.setVerticalBlockIncrement(-3);
		
		removePlayerButton = new JButton();
		removePlayerButton.setEnabled(false);
		removePlayerButton.setLocation(new IntPoint(398, 313));
		removePlayerButton.setSize(new IntDimension(98, 21));
		removePlayerButton.setText("Remove Player");
		
		label50 = new JLabel();
		label50.setLocation(new IntPoint(145, 5));
		label50.setSize(new IntDimension(60, 21));
		label50.setText("Race Name");
		
		raceName = new JTextField();
		raceName.setEnabled(false);
		raceName.setLocation(new IntPoint(215, 5));
		raceName.setSize(new IntDimension(95, 21));
		raceName.setPreferredSize(new IntDimension(100, 21));
		raceName.setEditable(false);
		
		label52 = new JLabel();
		label52.setLocation(new IntPoint(145, 29));
		label52.setSize(new IntDimension(65, 21));
		label52.setText("Player Name");
		
		playerName = new JTextField();
		playerName.setEnabled(false);
		playerName.setLocation(new IntPoint(215, 30));
		playerName.setSize(new IntDimension(95, 21));
		playerName.setEditable(true);
		
		addPlayerButton = new JButton();
		addPlayerButton.setEnabled(false);
		addPlayerButton.setLocation(new IntPoint(186, 56));
		addPlayerButton.setSize(new IntDimension(73, 21));
		addPlayerButton.setText("Add Player");
		
		victoryConditions = new Form();
		victoryConditions.setName("Victory Conditions");
		victoryConditions.setLocation(new IntPoint(3, 26));
		victoryConditions.setSize(new IntDimension(584, 341));
		var border11:EmptyBorder = new EmptyBorder();
		border11.setTop(5);
		border11.setLeft(5);
		border11.setBottom(5);
		border11.setRight(5);
		victoryConditions.setBorder(border11);
		
		formrow57 = new FormRow();
		formrow57.setLocation(new IntPoint(5, 5));
		formrow57.setSize(new IntDimension(574, 0));
		formrow57.setColumnChildrenIndecis("-1,0,1,2");
		
		formrow58 = new FormRow();
		formrow58.setLocation(new IntPoint(5, 7));
		formrow58.setSize(new IntDimension(574, 0));
		formrow58.setColumnChildrenIndecis("-1,0,1,2");
		
		formrow59 = new FormRow();
		formrow59.setLocation(new IntPoint(5, 9));
		formrow59.setSize(new IntDimension(574, 0));
		formrow59.setColumnChildrenIndecis("-1,0,1,2");
		
		formrow60 = new FormRow();
		formrow60.setLocation(new IntPoint(5, 11));
		formrow60.setSize(new IntDimension(574, 0));
		formrow60.setColumnChildrenIndecis("-1,0,1,2");
		
		formrow61 = new FormRow();
		formrow61.setLocation(new IntPoint(5, 13));
		formrow61.setSize(new IntDimension(574, 0));
		formrow61.setColumnChildrenIndecis("-1,0,1,2");
		
		separator62 = new JSeparator();
		separator62.setLocation(new IntPoint(5, 15));
		separator62.setSize(new IntDimension(574, 2));
		
		formrow63 = new FormRow();
		formrow63.setLocation(new IntPoint(5, 19));
		formrow63.setSize(new IntDimension(574, 0));
		formrow63.setColumnChildrenIndecis("-1,0,1,2");
		
		spacer64 = new JSpacer();
		spacer64.setLocation(new IntPoint(2, 0));
		spacer64.setSize(new IntDimension(245, 0));
		spacer64.setPreferredSize(new IntDimension(245, 0));
		
		doneButton = new JButton();
		doneButton.setLocation(new IntPoint(277, 0));
		doneButton.setSize(new IntDimension(38, 23));
		doneButton.setConstraints("Center");
		doneButton.setText("Done!");
		doneButton.setHorizontalAlignment(AsWingConstants.CENTER);
		
		//component layoution
		append(tabbedPane);
		
		tabbedPane.append(basicInfo);
		tabbedPane.append(mapSettings);
		tabbedPane.append(playerSettings);
		tabbedPane.append(victoryConditions);
		
		basicInfo.append(formrow18);
		basicInfo.append(formrow21);
		basicInfo.append(formrow24);
		basicInfo.append(formrow66);
		
		formrow18.append(label19);
		formrow18.append(gameName);
		
		formrow21.append(label22);
		formrow21.append(descriptionBox);
		
		formrow24.append(label25);
		formrow24.append(hostPassword);
		
		formrow66.append(spacer67);
		formrow66.append(loadComponentsButton);
		
		mapSettings.append(formrow28);
		mapSettings.append(formrow31);
		mapSettings.append(formrow36);
		mapSettings.append(formrow39);
		mapSettings.append(formrow42);
		
		formrow28.append(label29);
		formrow28.append(mapTypeBox);
		
		formrow31.append(label32);
		formrow31.append(numStars);
		
		formrow36.append(label37);
		formrow36.append(innerRadius);
		
		formrow39.append(label40);
		formrow39.append(outerRadius);
		
		formrow42.append(spacer44);
		formrow42.append(previewMapButton);
		
		playerSettings.append(raceList);
		playerSettings.append(findRaceButton);
		playerSettings.append(playersInvolved);
		playerSettings.append(removePlayerButton);
		playerSettings.append(label50);
		playerSettings.append(raceName);
		playerSettings.append(label52);
		playerSettings.append(playerName);
		playerSettings.append(addPlayerButton);
		
		victoryConditions.append(formrow57);
		victoryConditions.append(formrow58);
		victoryConditions.append(formrow59);
		victoryConditions.append(formrow60);
		victoryConditions.append(formrow61);
		victoryConditions.append(separator62);
		victoryConditions.append(formrow63);
		
		formrow63.append(spacer64);
		formrow63.append(doneButton);
		
	}
	
	//_________getters_________
	
	public function getTabbedPane():JTabbedPane{
		return tabbedPane;
	}
	
	
	
	
	public function getGameName():JTextField{
		return gameName;
	}
	
	
	
	public function getDescriptionBox():JTextArea{
		return descriptionBox;
	}
	
	
	
	public function getHostPassword():JTextArea{
		return hostPassword;
	}
	
	
	
	public function getLoadComponentsButton():JButton{
		return loadComponentsButton;
	}
	
	
	
	
	public function getMapTypeBox():JComboBox{
		return mapTypeBox;
	}
	
	
	
	public function getNumStars():JAdjuster{
		return numStars;
	}
	
	
	
	public function getInnerRadius():JAdjuster{
		return innerRadius;
	}
	
	
	
	public function getOuterRadius():JAdjuster{
		return outerRadius;
	}
	
	
	
	public function getPreviewMapButton():JButton{
		return previewMapButton;
	}
	
	
	public function getRaceList():JList{
		return raceList;
	}
	
	public function getFindRaceButton():JButton{
		return findRaceButton;
	}
	
	public function getPlayersInvolved():JTable{
		return playersInvolved;
	}
	
	public function getRemovePlayerButton():JButton{
		return removePlayerButton;
	}
	
	
	public function getRaceName():JTextField{
		return raceName;
	}
	
	
	public function getPlayerName():JTextField{
		return playerName;
	}
	
	public function getAddPlayerButton():JButton{
		return addPlayerButton;
	}
	
	
	
	
	
	
	
	
	
	
	public function getDoneButton():JButton{
		return doneButton;
	}
	
	
}
